﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using Zenject;

namespace DiIoc.Signal.ZenjectSignal
{
    public class PlayerController : MonoBehaviour
    { 
        [Range(1f,100f)]
        public int Health;
        [Inject]
        readonly SignalBus _signalBus;

        private void OnMouseDown()
        {
            Health = Mathf.Clamp(--Health, 0, 100);
            _signalBus.Fire(new PlayerHealthSignal { Username = gameObject.name, Health = Health });
        }
 
 
    }
}

